package com.cfx.exercise_32;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

public class TestIO {
	//读取文本文件
	public static void main(String[] args) throws IOException {
		BufferedReader br = null;
		try {
				br = new BufferedReader(new InputStreamReader(new FileInputStream("C:\\Users\\zs\\Desktop\\测试IO.txt"), "GBK"));
				String len = "";
				while((len = br.readLine())!= null){
					System.out.println(len);					
				}
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			br.close();
		}	
	}
}
